/*
 * @copyright 2010 Gerald Jacobson
 * @license GNU General Public License
 * 
 * This file is part of Descent Assistant.
 *
 * Descent Assistant is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Descent Assistant is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Descent Assistant.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.amphiprion.descenttool.util;

import java.util.Comparator;

import org.amphiprion.descenttool.entity.AvailableMonster;

/**
 * @author Amphiprion
 * 
 */
public class AvailableMonsterComparator implements Comparator<AvailableMonster> {

	@Override
	public int compare(AvailableMonster object1, AvailableMonster object2) {
		if (object1 == null || object2 == null || object1.name == null) {
			return 0;
		} else {
			return object1.name.compareTo(object2.name);
		}
	}
}
